function sortedSquares(nums: number[]): number[] {
    const result: number[] = nums.map((item) => item * item).sort((a, b) => a - b);
    // nums.sort((a, b) => a - b);
    console.log(result);
    return result;
};

const nums8 = [-4, -1, 0, 3, 10];
sortedSquares(nums8)
